﻿<UserControl
			xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			xmlns:local="clr-namespace:VSMantisConnect.Views"
			xmlns:ui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
			xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" x:Class="VSMantisConnect.Views.IssuesList"
			mc:Ignorable="d"
			d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>
		<local:StringShrinker x:Key="SummaryGetter"/>
	</UserControl.Resources>
	<Grid>
		<TreeView Grid.Row="1" x:Name="lstIssues" ItemsSource="{Binding}" SelectedItemChanged="lstIssues_SelectedItemChanged" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogTreeViewStyleKey}}" IsTextSearchEnabled="True">
			<TreeView.ItemTemplate>
				<HierarchicalDataTemplate ItemsSource="{Binding Issues}">
					<Label Content="{Binding Project.name}" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}"/>
					<HierarchicalDataTemplate.ItemTemplate>
						<DataTemplate>
							<StackPanel>
								<Label Content="{Binding id}" FontWeight="Bold" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}" />
								<Label Content="{Binding summary}" FontWeight="Bold" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}" />
								<Label Content="{Binding description, Converter={StaticResource SummaryGetter}, ConverterParameter=50}" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}" />
							</StackPanel>
						</DataTemplate>
					</HierarchicalDataTemplate.ItemTemplate>
				</HierarchicalDataTemplate>
			</TreeView.ItemTemplate>
		</TreeView>
	</Grid>
</UserControl>
